//
//  WlisEssenceVC.swift
//  Swift_missScarlett
//
//  Created by xmg on 16/8/13.
//  Copyright © 2016年 wlis. All rights reserved.
//

import UIKit

class WlisEssenceVC: WlisDisplayBaseVC {

    override func viewDidLoad() {
        super.viewDidLoad()
        /** 添加控制器 */
        setUpAllChildVC()
        setUpNavBar()
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
       
    }
    


}
// MARK: - 添加控制器
extension WlisEssenceVC{
    private func setUpAllChildVC(){
        let allVc = WlisAllVC()
        allVc.title = "全部"
        self.addChildViewController(allVc)
        let videoVc = WlisVideoVC()
        videoVc.title = "视频"
        self.addChildViewController(videoVc)
        let voiceVc = WlisVoiceVC()
        voiceVc.title = "声音"
        self.addChildViewController(voiceVc)
        let pictureVc = WlisPictureVC()
        pictureVc.title = "图片"
        self.addChildViewController(pictureVc)
        let textVc = WlisTextVC()
        textVc.title = "段子"
        self.addChildViewController(textVc)
    }
}
// MARK: - 设置导航条
extension WlisEssenceVC{
    private func setUpNavBar(){
        // 左边
        self.navigationItem.leftBarButtonItem = UIBarButtonItem.itemWithCustomView("nav_item_game_icon", imageHigh: "nav_item_game_click_icon", target: self, action: "gameClick")
        
        // titleView
        self.navigationItem.titleView = UIImageView(image: UIImage(named: "MainTitle"))
        
        // 右边
        self.navigationItem.rightBarButtonItem = UIBarButtonItem.itemWithCustomView("navigationButtonRandom", imageHigh: "navigationButtonRandomClick", target: nil, action:nil)
    }
    @objc func gameClick(){
    print("点击按钮")
    }
}